<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Auth::routes();

//Route::get('/', 'Home\IndexController@index');

// 企业进驻
Route::group(['prefix' => 'company'], function () {
    Route::get('/', 'Home\CompanyController@index');
    Route::get('/apply', 'Home\CompanyController@apply');
    Route::post('/uploadImages', 'Home\CompanyController@uploadImages');
    Route::post('/submit', 'Home\CompanyController@submit');
});

Route::post('/login', 'Home\IndexController@login');
Route::post('/quickLogin', 'Home\IndexController@quickLogin');
Route::post('/register', 'Home\IndexController@register');
Route::post('/sendVerifyCode', 'Home\IndexController@sendVerifyCode');
Route::post('/bindMobile', 'Home\IndexController@bindMobile');

//微信授权
Route::get('/','Home\IndexController@index');
Route::get('gotoWechat','Home\WechatController@authorization');
Route::get('callBack','Home\WechatController@callBack');
Route::get('getJSSDK','Home\WechatController@getJSSDK');

Route::post('/modifyUserInfo', 'Home\UserController@modifyUserInfo');

Route::group(['prefix' => 'home'], function () {
    //任务
    Route::group(['prefix' => 'task'], function () {
        Route::get('/', 'Home\TaskController@index');
        Route::post('getTask/{id}', 'Home\TaskController@getTask');
        Route::post('uploadTaskImages', 'Home\TaskController@uploadTaskImages');
        Route::post('finishTask/{id}', 'Home\TaskController@finishTask');
        Route::get('/getTaskInfo/{id}', 'Home\TaskController@getTaskInfo');
        Route::get('/getUserTaskLists', 'Home\TaskController@getUserTaskLists');
        Route::post('applyExtractCash', 'Home\TaskController@applyExtractCash');
        Route::get('getApplyExtractCashRecord', 'Home\TaskController@getApplyExtractCashRecord');
        Route::get('getTaskMoneyDetail', 'Home\TaskController@getTaskMoneyDetail');
    });

    //个人中心
    Route::group(['prefix' => 'user'], function () {
        Route::post('/modifyPassword', 'Home\UserController@modifyPassword');
        Route::post('/uploadAvatar', 'Home\UserController@uploadAvatar');
        Route::get('getFriendLists', 'Home\UserController@getFriendLists');
        Route::get('getFriendTasks', 'Home\UserController@getFriendTasks');
        Route::get('getUserInfo', 'Home\UserController@getUserInfo');
        Route::get('getUserInfoByAccount', 'Home\UserController@getUserInfoByAccount');
        Route::get('getWechatUserInfo', 'Home\UserController@getWechatUserInfo');
        Route::get('getMessagesLists','Home\UserController@getMessagesLists');
        Route::get('getMessagesDetail/{id}','Home\UserController@getMessagesDetail');
        Route::post('changeMsgState','Home\UserController@changeMsgState');
        Route::post('bindRecommendUser', 'Home\UserController@bindRecommendUser');
    });
});

Route::group(['prefix' => 'admin'], function () {
    Route::get('/', 'Admin\TaskController@lists');
    Route::get('login', 'Admin\IndexController@login');
    Route::post('doLogin', 'Admin\IndexController@doLogin');
    //任务管理
    Route::group(['prefix' => 'task'], function () {
        Route::get('lists', 'Admin\TaskController@lists');
        Route::get('mylists', 'Admin\TaskController@mylists');
        Route::get('getLists', 'Admin\TaskController@getLists');
        Route::get('create', 'Admin\TaskController@create');
        Route::get('edit/{id}', 'Admin\TaskController@edit');
        Route::get('show/{id}', 'Admin\TaskController@show');
        Route::post('verify/{id}', 'Admin\TaskController@verify');
        Route::post('save/{id?}', 'Admin\TaskController@save');
        Route::post('uploadImages', 'Admin\TaskController@uploadImages');
        Route::get('verifyTaskLists', 'Admin\TaskController@verifyTaskLists');
        Route::get('getVerifyTaskLists', 'Admin\TaskController@getVerifyTaskLists');
        Route::get('verifyOrderLists/{id}', 'Admin\TaskController@verifyOrderLists');
        Route::get('getVerifyOrderLists/{id}', 'Admin\TaskController@getVerifyOrderLists');
        Route::get('exportOrderLists/{id}', 'Admin\TaskController@exportOrderLists');
        Route::post('verifyOrder/{id}', 'Admin\TaskController@verifyOrder');
        Route::get('verifyCashLists', 'Admin\TaskController@verifyCashLists');
        Route::get('getCashLists', 'Admin\TaskController@getCashLists');
        Route::get('checkCashApply/{id}', 'Admin\TaskController@checkCashApply');
        Route::get('getCashApplyInfo/{id}', 'Admin\TaskController@getCashApplyInfo');
        Route::post('verifyCashApply/{id}', 'Admin\TaskController@verifyCashApply');
    });
    //用户列表
    Route::group(['prefix' => 'user'], function () {
        Route::get('/', 'Admin\UserController@index');
        Route::get('getLists', 'Admin\UserController@getLists');
        Route::get('show/{id}', 'Admin\UserController@show');
        Route::post('forbid', 'Admin\UserController@forbid');
        Route::get('taskLists/{id}', 'Admin\UserController@taskLists');
        Route::get('getUserInfo/{id}', 'Admin\UserController@getUserInfo');
        Route::get('getTaskLists/{id}', 'Admin\UserController@getTaskLists');
        Route::get('getCashLists/{id}', 'Admin\UserController@getCashLists');
        Route::get('getBalanceLists/{id}', 'Admin\UserController@getBalanceLists');
        Route::get('getMonthDetails/{id}', 'Admin\UserController@getMonthDetails');
        Route::get('getFriendLists/{id}', 'Admin\UserController@getFriendLists');
        Route::get('getUserLoginLogs/{id}', 'Admin\UserController@getUserLoginLogs');
    });

    //后台管理
    Route::group(['prefix' => 'manager'], function () {
        Route::get('myPower', 'Admin\ManagerController@myPower');
        Route::get('sendMsg', 'Admin\ManagerController@sendMsg');
        Route::get('msgTrigger', 'Admin\ManagerController@msgTrigger');
        Route::get('getTriggerLists', 'Admin\ManagerController@getTriggerLists');
        Route::post('saveTrigger', 'Admin\ManagerController@saveTrigger');
        Route::get('getUsersLists', 'Admin\ManagerController@getUsersLists');
        Route::post('sendMessages', 'Admin\ManagerController@sendMessages');
    });

    //后台管理
    Route::group(['prefix' => 'company'], function () {
        Route::get('/', 'Admin\CompanyController@index');
        Route::get('/getLists', 'Admin\CompanyController@getLists');
        Route::get('/show/{id}', 'Admin\CompanyController@show');
        Route::post('/delete/{id}', 'Admin\CompanyController@delete');
    });
});
